﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Sessions.aspx.cs" Inherits="Network_Sessions" Title="Sessions" %>

<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server">
    <asp:UpdatePanel ID="updatePanel1" runat="server">
        <ContentTemplate>
            <asp:Button ID="btnRefresh" runat="server" Text="Refresh" BackColor="#E3EAEB" BorderStyle="None"
                Height="19px" Width="100%" />
            <asp:ListView ID="lvSessions" runat="server" DataSourceID="dsSessions">
                <LayoutTemplate>
                    <table style="width: 100%" cellpadding="4" cellspacing="0">
                        <thead>
                            <tr>
                                <th>
                                    Share
                                </th>
                                <th>
                                    User name
                                </th>
                                <th>
                                    Computer name
                                </th>
                                <th>
                                    Number of files
                                </th>
                                <th>
                                    Active time
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr id="itemPlaceholder" runat="server" />
                        </tbody>
                    </table>
                </LayoutTemplate>               
                <ItemTemplate>
                    <tr>
                        <td class="item">
                            <%#Eval("ShareName")%>
                        </td>
                        <td class="item">
                            <%#Eval("UserName")%>
                        </td>
                        <td class="item">
                            <%#Eval("ComputerName")%>
                        </td>
                        <td class="item">
                            <%#Eval("NumberOfFiles")%>
                        </td>
                        <td class="item">
                            <%#Eval("ActiveTimeSpan")%>
                        </td>
                    </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                    <tr>
                        <td class="item2">
                            <%#Eval("ShareName")%>
                        </td>
                        <td class="item2">
                            <%#Eval("UserName")%>
                        </td>
                        <td class="item2">
                            <%#Eval("ComputerName")%>
                        </td>
                        <td class="item2">
                            <%#Eval("NumberOfFiles")%>
                        </td>
                        <td class="item2">
                            <%#Eval("ActiveTimeSpan")%>
                        </td>
                    </tr>
                </AlternatingItemTemplate>
                <EmptyDataTemplate>
                <div style="font-style: italic; text-align: center; background-color: #FFFFFF">
                No active sessions
                </div>
                </EmptyDataTemplate>
            </asp:ListView>
            Total sessions:<%=lvSessions.Items.Count %>
            <asp:LinqDataSource ID="dsSessions" runat="server" ContextTypeName="NetworkSessionsWrapper"
                TableName="Sessions">
            </asp:LinqDataSource>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="head">
    <style type="text/css">
        .style1
        {
            width: 113px;
        }
        td.item
        {
            background-color: #EFF3FB;
        }
        td.item2
        {
            background-color: White;
            color: #284775;
        }
        thead > tr
        {
            background-color: #5D7B9D;
            font-weight: bold;
            color: White;
        }
    </style>
</asp:Content>
